package reso.testing;

import org.junit.Test;

import reso.ip.IPAddress;
import junit.framework.TestCase;

public class TestIPAddress extends TestCase {

	@Test
	public void testEquality() throws Exception {
		IPAddress a1= IPAddress.getByAddress("10.0.0.1");
		IPAddress a2= IPAddress.getByAddress("10.0.0.1");
		assertEquals(a1, a2);
	}
	
	@Test
	public void testComparison() throws Exception {
		IPAddress a1= IPAddress.getByAddress("10.0.0.1");
		IPAddress a2= IPAddress.getByAddress("10.0.0.2");
		assertTrue(a1.compareTo(a1) == 0);
		assertTrue(a1.compareTo(a2) < 0);
		assertTrue(a2.compareTo(a1) > 0);
	}
	
}
